package Source;

import java.util.ArrayList;

/**
 *
 * @author Joshua King
 */
public class EditAirport {
    private String APLocation;
    private String APName;
    private String APTax;
    
    public boolean checkValidity() {
        if (APLocation.equals("") || APName.equals("") || APTax.equals("")) {
            return false;
        }
        return true;
    }

    public boolean commitData() {
        FlightServerInteraction logIn = new FlightServerInteraction();
        ArrayList<String> request = new ArrayList<String>();
        request.add(0, "airportEdit");
        request.add(1, "AIRPORT_LOCATION");
        request.add(2, APLocation);
        request.add(3, APName);
        logIn.run(request);
        request = new ArrayList<String>();
        request.add(0, "airportEdit");
        request.add(1, "AIRPORT_TAX");
        request.add(2, APTax);
        request.add(3, APName);
        logIn.run(request);
        return true;
    } 
    public void setAPLocation(String text) {
        APLocation = text;
    }

    public void setAPName(Object selectedItem) {
        APTax = (String) selectedItem;
    }

    public void setAPTax(String text) {
        APTax = text;
    }

}
